package com.example.isoftservice.service.email;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 公共返回对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EmailRespBean {
    private long code;
    private String message;
    private Object obj;

    /**
     * 成功返回结果
     * @param message
     * @return
     */
    public static EmailRespBean success(String message){
        return new EmailRespBean(200,message,null);
    }

    /**
     * 成功返回结果
     * @param message
     * @param data
     * @return
     */
    public static EmailRespBean success(String message, Object data){
        return new EmailRespBean(200,message,data);
    }

    /**
     * 失败返回结果
     * @param message
     * @return
     */
    public static EmailRespBean error(String message){
        return new EmailRespBean(500,message,null);
    }

    /**
     * 失败返回结果
     * @param message
     * @param data
     * @return
     */
    public static EmailRespBean error(String message, Object data){
        return new EmailRespBean(500,message,data);
    }
}


